<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>监听响应式变量</title>
    <script src="https://unpkg.com/vue@next"></script>
  </head>
  <body>
    <div id="Application">
      
    </div>
  </body>

  <script>
    const App = Vue.createApp({
        setup(){
            let a=Vue.ref(1)
            let stop = Vue.watchEffect(()=>{
                console.log("变量a变化了")
                console.log(a.value)
            })
            a.value=2
            //手动停止监听
            stop()
            a.value=3
            return{
                a
            }
        }
    })
    App.mount("#Application")
  </script>

</html>